from django.contrib import admin
from comments.models import *



@admin.register(Comment)
class CommentAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'email', 'url', 'created_time')
    list_display_links = ('name',)  # 点击进去详情页
    list_per_page = 20
    ordering = ('-created_time',)  # 倒叙排序
    list_filter = ('name',)  # 过滤器
    # readonly_fields = ['email']
    search_fields = ('name',)  # 后台的搜索

    # filter_horizontal = ('tags',)
    # fieldsets = (
    #     # ("base info", {'fields': ['title', 'author', 'tags']}),
    #     ("base info", {'fields': ['title', 'author',]}),
    #     ("Content", {'fields': ['content']})
    # )